<template>
    <div class="table">
        <div class="divSearch">
            <!--搜索框-->
            <Row>
                <!--根据需求删除不不要查询条件-->
                <Col :lg="{span:5}" :md="{span:8}" :sm="{span:16}" :xs="{span:22}">
                    <label class="searchLabel">填报年度:</label>
                    <Select v-model="searchModel.FillInYear" placeholder="请选择..." :label-in-value="true" @on-change="getPageData()" class="searchInput">
                        <Option :value="item.DictText" v-for="item in CreateYearList" :key="item.DictText">{{item.DictText}}</Option>
                    </Select>
                </Col>
                <!-- <Col :lg="{span:5}" :md="{span:8}" :sm="{span:16}" :xs="{span:22}">
                    <label class="searchLabel">填报季度:</label>
                   <Select  placeholder="请选择..." class="searchInput"  v-model="searchModel.CycleValue">
						<Option v-for="item in QuarterCycleList" :value="item.DictValue" :key="item">{{ item.DictText }}</Option>
					</Select>	
                </Col> -->
                <Col :lg="{span:2}" :md="{span:2}" :sm="{span:2}" :xs="{span:2}" v-show="isFull">
                    <Button icon="ios-search" type="primary" @click="getPageData()" class="searchButton">查询</Button>
                </Col>
               <Col :lg="{span:2}" :md="{span:2}" :sm="{span:2}" :xs="{span:2}" style="float:right">
                    <Button icon="ios-cloud-download" type="primary" @click="TmpDown()" class="searchButton">模板下载</Button>
                </Col>
            </Row>
        </div>
        <div v-if="isFull">
            <Row>
                <Col>
                    <Table :context="self" ref="table" :stripe=true :border=true :columns="TableHeader" :data="datas.rows" size="large" :height="clientHeight">
                    </Table>
                </Col>
            </Row>
            <Row>
                <Col span="24">
                <Page class="pageComponent" :total="datas.total" placement="top" @on-change="getPageNumber" :page-size="searchModel.PageSize" :page-size-opts='pageSizeOpts' show-sizer @on-page-size-change="getPageSize" show-total show-elevator></Page>
                </Col>
            </Row>
        </div>
        <div class="FIllTip" v-else>温馨提示:本时段不在系统报表填报时间内，请耐心等待。</div>
        <!--**********************************数据编辑框***************************************************************-->
        <Modal v-model="showType" :mask-closable="false" width="1500" :styles="{top: '10px'}">
            <p slot="header" class="title">
                <Icon type="ios-paper" size="20"></Icon>
                <span style="font-size: 20px">(四){{searchModel.FillInYear}}主要蔬菜播种面积、产量年度调查(全面统计)——<span class="Tip">单位(亩、吨、吨/亩)</span></span>
            </p>
            <p slot="close">
                <Icon type="close-circled" color="red" size=25></Icon>
            </p>
            <table class="DetailTable">
                <thead>
                    <tr>
                        <!-- <td rowspan="2" width="10%" style="display:none">分类</td>                     -->
                        <th rowspan="2">种类</td>
                        <th rowspan="2">全年<br/>蔬菜<br/>累计<br/>播种<br/>面积<br/>合计</th>
                        <th rowspan="2">全年<br/>蔬菜<br/>总产<br/>量</th>
                        <th rowspan="2">平均<br/>单产</th>
                        <!-- <td colspan="2" width="15%">露地蔬菜</td>
                        <td colspan="2" width="15%">小棚蔬菜</td>
                        <td colspan="2" width="15%">大中棚蔬菜</td>                          
                        <td colspan="2" width="15%">温室蔬菜</td> -->
                        <th colspan="12">其中</th>
                        <th rowspan="2" style="width:186px">备注</th>                            
                    </tr>
                    <tr>
                        <th>全年露地蔬菜累计播种面积</th>
                        <th>全年露地蔬菜产量</th>
                        <th>露地单产</th>
                        <th>全年小棚蔬菜累计播种面积</th>
                        <th>全年小棚蔬菜产量</th>
                        <th>小棚单产</th>
                        <th>全年大中棚蔬菜累计播种面积</th>
                        <th>全年大中棚蔬菜产量</th>
                        <th>大中棚单产</th>
                        <th>全年温室蔬菜累计播种面积</th>
                        <th>全年温室蔬菜产量</th>
                        <th>温室单产</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(item,index) in ItemList" :key="item.ItemName"  :class="{'tdColor':index%2!=0}">
                        <td  class="disableTd"  :class="{'ItemTd':item.SortCode.length>8}">{{item.ItemName}}</td>
                        <td  class="disableTd">{{getZero(item.LD_Area)+getZero(item.XP_Area)+getZero(item.DZP_Area)+getZero(item.WS_Area)|formatCurrency}}</td>
                        <td  class="disableTd">{{getFloat(getZero(item.LD_Product)+getZero(item.XP_Product)+getZero(item.DZP_Product)+getZero(item.WS_Product))|formatCurrency}}</td>
                        <td  class="disableTd">{{getDivided(getZero(item.LD_Product)+getZero(item.XP_Product)+getZero(item.DZP_Product)+getZero(item.WS_Product),getZero(item.LD_Area)+getZero(item.XP_Area)+getZero(item.DZP_Area)+getZero(item.WS_Area))}}</td>
                        <td><Input placeholder="露地蔬菜播种面积"  v-model="item.LD_Area" @on-blur="checkFormData(item.LD_Area)"></Input></td>
                        <td><Input placeholder="露地蔬菜产量"  v-model="item.LD_Product" @on-blur="checkFormData(item.LD_Product)"></Input></td>
                        <td  class="disableTd">{{getDivided(getZero(item.LD_Product),getZero(item.LD_Area))}}</td>
                        <td><Input placeholder="小棚蔬菜播种面积" v-model="item.XP_Area" @on-blur="checkFormData(item.XP_Area)"></Input></td>
                        <td><Input placeholder="小棚蔬菜产量" v-model="item.XP_Product" @on-blur="checkFormData(item.XP_Product)"></Input></td>
                        <td  class="disableTd">{{getDivided(getZero(item.XP_Product),getZero(item.XP_Area))}}</td>
                        <td><Input placeholder="大中棚蔬菜播种面积" v-model="item.DZP_Area" @on-blur="checkFormData(item.DZP_Area)"></Input></td>
                        <td><Input placeholder="大中棚蔬菜产量" v-model="item.DZP_Product" @on-blur="checkFormData(item.DZP_Product)"></Input></td>
                        <td  class="disableTd">{{getDivided(getZero(item.DZP_Product),getZero(item.DZP_Area))}}</td>
                        <td><Input placeholder="温室蔬菜播种面积" v-model="item.WS_Area" @on-blur="checkFormData(item.WS_Area)"></Input></td>
                        <td  ><Input placeholder="温室蔬菜产量" v-model="item.WS_Product"></Input></td>
                        <td  class="disableTd">{{getDivided(getZero(item.WS_Product),getZero(item.WS_Area))}}</td>
                        <td style="width:186px"><Input placeholder="输入字数小于150个" v-model="item.Remark"></Input></td>
                    </tr>
                </tbody>
            </table>
            <table  class="DetailTable">
                <tbody>
                    <tr>
                        <td class="disableTd">合计</td>
                        <td class="disableTd">{{total_Area}}</td>
                        <td class="disableTd">{{total_Product}}</td>
                        <td class="disableTd">{{getFloat(total_Product/total_Area)}}</td>
                        <td class="disableTd">{{totalLD_Area}}</td>
                        <td class="disableTd">{{totalLD_Product}}</td>
                        <td class="disableTd">{{getFloat(totalLD_Product/totalLD_Area)}}</td>
                        <td class="disableTd">{{totalXP_Area}}</td>
                        <td class="disableTd">{{totalXP_Product}}</td>
                        <td class="disableTd">{{getFloat(totalXP_Product/totalXP_Area)}}</td>
                        <td class="disableTd">{{totalDZP_Area}}</td>
                        <td class="disableTd">{{totalDZP_Product}}</td>
                        <td class="disableTd">{{getFloat(totalDZP_Product/totalDZP_Area)}}</td>
                        <td class="disableTd">{{totalWS_Area}}</td>
                        <td class="disableTd">{{totalWS_Product}}</td>
                        <td class="disableTd">{{getFloat(totalWS_Product/totalWS_Area)}}</td>
                        <td class="disableTd"  style="width:186px"></td>
                    </tr>
                </tbody>
            </table>
            <div class="buttons">
                <Button type="primary" icon="checkmark" @click="save()" v-show="ReportStatus<=2">保存</Button>
                <Button type="success" icon="arrow-up-a" @click="DataUp('3','')" v-show="ReportStatus==2">上报</Button>                    
                <Button type="error" icon="close-round" @click="cancel()">关闭</Button>
            </div>
            <div slot="footer">
                <Alert class="alert" banner type="error">
                    <p>填报时间：每年1月10日</p>
                    <p>1.全省范围内从乡（镇）起，逐级全面统计，由县级填报经州（市）审核后上报。</p>
                    <p>2.蔬菜累计播种面积合计=露地蔬菜累计播种面积+小棚蔬菜累计播种面积+大中棚蔬菜累计播种面积+温室蔬菜累计播种面积。</p>
                    <p>3.蔬菜累计播种面积合计=露地蔬菜累计播种面积+小棚蔬菜累计播种面积+大中棚蔬菜累计播种面积+温室蔬菜累计播种面积。</p>
                    <span slot="desc"></span>
                </Alert>
            </div>
        </Modal>
    </div>
</template>
<script>
export default {
    data() {
        return {
            self: this,
            TableCodeList: this.GetGroupDict("ReportTableName"), //表名称
            CreateYearList: this.GetGroupDict("ReportYear"), //周期
            CycleList: this.GetGroupDict("ReportCycle"), //
            QuarterCycleList:this.GetGroupDict("QuarterCycleValue"),//月份周期值
            CurrentYear: this.GetCurrentYear(),//当前年度
            selectTabName: '',
            ReportId:0,
            isFull:false,
            ReportStatus:false,
            showType: false, //编辑框状态开关
            ViewType: false, //查看框状态开关
            TableHeader: [{
                    title: '报表名称',
                    key: 'ReportCodeName',
                    ellipsis: true,
                    sortable: true
                    // width: 200
                },
                // {
                //     title: '归属地区',
                //     key: 'AreaCodeName',
                //     width: 150
                // },
                // {
                //     title: '填报年度',
                //     key: 'FillInYearName',
                //     width: 150
                // },
                // {
                //     title: '填报周期',
                //     key: 'TimesTypeName',
                //     width: 120
                // },
                // {
                //     title: '填报季度',
                //     key: 'FillInYearName',
                //     width: 150
                // },
                // {
                //     title: '审核意见',
                //     key: 'Opinion',
                //     width: 150,
                //     ellipsis: true
                // },
                {
                    title: "报表状态",
                    key: "StatusName",
                    width: 150,
                    render: (h, params) => {
                        switch (params.row.Status * 1) {
                            case 0: //审核未通过
                                return h('span', { class: { Error: true } }, params.row.StatusName);
                            case 1: //未填报
                                return h('span', { class: { NoReport: true } }, params.row.StatusName);
                            case 2: //已填报
                                return h('span', { class: { AlreadyReport: true } }, params.row.StatusName);
                            case 3: //已上报
                                return h('span', { class: { UpReport: true } }, params.row.StatusName);
                            case 4: //审核通过
                                return h('span', { class: { Success: true } }, params.row.StatusName);
                            case 5: //锁定
                                return h('span', { class: { error: true } }, params.row.StatusName);
                            default:
                                return h('span', { class: { Default: true } }, params.row.StatusName);
                        }
                    }
                },
                {
                    title: '添加时间',
                    key: 'StrAddTime',
                    ellipsis: true,
                    width: 180
                },
                {
                    title: '操作',
                    key: 'action',
                    width: 250,
                    align: 'center',
                    render: (h, params) => {
                        return h('div', [
                            h('Upload', {
                                props: {
                                    //导入成功后响应窗口
                                    onSuccess: () => { this.handleSuccess() },
                                    action: this.GetPostUrl(params.row.Id),
                                    size: 'small'
                                },
                                style: {
                                    float: 'left', marginTop: '2px',marginRight: '5px'
                                }
                            }, [h('Button', {
                                class: { searchButton: true },
                                props: {
                                    type:'ghost',size: 'small', icon: 'ios-cloud-upload-outline',
                                    disabled: params.row.Status == 3||params.row.Status == 4
                                },
                                style: {
                                    marginRight: '5px'
                                }
                            }, '导入')]),
                            // h('Button', {
                            //     class: { ieditColor: true },
                            //     props: {
                            //         type: 'ghost', size: 'small', icon: 'ios-compose'
                            //     },
                            //     style: { marginRight: '5px', marginTop: '10px' ,color:'red'},
                            //     on: {
                            //         click: () => { this.See(params.row.Id, params.row.ReportCode); }
                            //     }
                            // }, '查看'),
                            h('Button', {
                                class: { ieditColor: true },
                                props: {
                                    type: 'ghost', size: 'small', icon: 'ios-compose'
                                },
                                // attrs: {
                                //     disabled: params.row.Status > 2 ? true : false
                                // },
                                style: { marginRight: '5px', marginTop: '10px' },
                                on: {
                                    click: () => { this.Edit(params.row.Id, params.row.ReportCode,params.row.Status); }
                                }
                            }, '填报'),
                            // h('Button', {
                            //     class: { ieditColor: true },
                            //     props: {
                            //         type: 'ghost', size: 'small', icon: 'arrow-up-a'
                            //     },
                            //     attrs: {
                            //         disabled: params.row.Status != 2 ? true : false
                            //     },
                            //     style: { marginRight: '5px', marginTop: '10px' },
                            //     on: {
                            //         click: () => { this.DataUp(params.row.Id, '3', ''); }
                            //     }
                            // }, '上报'),
                            h('Button', {
                                class: { ieditColor: true },
                                props: {
                                    type: 'ghost', size: 'small', icon: 'ios-compose'
                                },
                                attrs: {
                                    disabled: params.row.Status < 1 ? true : false
                                },
                                style: { marginRight: '5px', marginTop: '10px' },
                                on: {
                                    click: () => { this.ExcelDown(params.row.Id); }
                                }
                            }, '导出')
                        ]);
                    }
                }
            ],
            //查询模型：根据需求删除不不要查询条件
            //蔬菜生产情况表代码
            searchModel: {
                Id: '',
                ReportCode: 'VegProSurveyYear',
                FillInYear: '',
                TimesType: '1',//按年度填报
                CycleValue:'',//季度值
                AreaCode: '',
                PageNumber: 1,
                PageSize: 20,
                Status: '',
                Opinion: '',
                options:''
            },
            pageSizeOpts: [20, 40, 50], //默认分页最大设置
            datas: {}, //table数据对象
            dataIds: [],
            ctx: this, //table数据上下文
            clientHeight: window.innerHeight - 300, //表格默认高度
        }
    },
    mounted() {
        //table高度计算方法
        const that = this;
        window.onresize = () => {
            return (() => {
                that.clientHeight = window.innerHeight - 300;
            })()
        };
    },
    computed: { //蔬菜累计播种面积合计
        totalLD_Area:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].LD_Area==null?Number(0):Number(this.ItemList[i].LD_Area);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        totalXP_Area:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].XP_Area==null?Number(0):Number(this.ItemList[i].XP_Area);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        totalDZP_Area:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].DZP_Area==null?Number(0):Number(this.ItemList[i].DZP_Area);
                        }
                    }
                  
                }
                // return Math.round(total*100)/100;
                return Math.round(total*100)/100;
            }
        },
        totalWS_Area:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].WS_Area==null?Number(0):Number(this.ItemList[i].WS_Area);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        total_Area:{
            get:function(){
                var total=this.totalLD_Area+this.totalXP_Area+this.totalDZP_Area+this.totalWS_Area;
                return Math.round(total*100)/100;
            }
        },
        totalLD_Product:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].LD_Product==null?Number(0):Number(this.ItemList[i].LD_Product);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        totalXP_Product:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].XP_Product==null?Number(0):Number(this.ItemList[i].XP_Product);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        totalDZP_Product:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].DZP_Product==null?Number(0):Number(this.ItemList[i].DZP_Product);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        totalWS_Product:{
            get:function(){
                var total=0;
                if(this.ItemList!=null&&this.ItemList.length>0)
                { 
                    for(var i=0;i<this.ItemList.length;i++)
                    {
                        if(this.ItemList[i].SortCode.length==8)
                        {
                            total+=this.ItemList[i].WS_Product==null?Number(0):Number(this.ItemList[i].WS_Product);
                        }
                    }
                  
                }
                return Math.round(total*100)/100;
            }
        },
        total_Product:{
            get:function(){
                var total=Number(this.totalLD_Product)+Number(this.totalXP_Product)+Number(this.totalDZP_Product)+Number(this.totalWS_Product);
                return Math.round(total*100)/100;
            }
        },
    },
    methods: {
        checkFormData(value) {
            var temp = /^[0-9]\d*(\.\d+)?$/;
            if (value != null && value != "") {
                if (temp.test(value) == false) {
                    this.$Notice.error({
                        title: '必须是大于等于0的数字',
                        desc: false
                    });
                }
                else {
                    return;
                }
            }
            else {
                return;
            }
        },
        See: function (id, reportCode) { //数据查看
            var self = this;
            self.$http.get("Report", {
                params: {
                    id: id,
                    reportCode: reportCode
                }
            }).then( //获取数据编辑项的值
                function (res) {
                    switch (res.data.list.status) {
                        case 1:
                            self.initTab(self, res.data.list.model);
                            self.ViewType = true;
                            break;
                        case 0:
                            self.$Modal.error({
                                title: "提示信息",
                                content: "数据加载失败!!!"
                            });
                            break;
                        case -1:
                            self.$Modal.error({
                                title: "提示信息",
                                content: "数据加载失败!!!"
                            });
                            break;
                    }
                }
                );
        },
        getTab(name) { //获取当前tab
            this.selectTabName = name;
        },
        //查看报表
        showInfo(id, reportCode) {
        },
        //获取当前页码
        getPageNumber(pageIndex) {
            this.searchModel.PageNumber = pageIndex;
            this.getPageData();
        },
        //获取当前分页大小
        getPageSize(pageSize) {
            this.searchModel.PageSize = pageSize;
            this.getPageData();
        },
        //获取this.datas: {},//table数据对象
        getPageData() {
            var self = this;
            var user = this.GetlocaStorage("VegUserInfo");
            if (self.searchModel.FillInYear != null && self.searchModel.FillInYear != '') {
                self.isFull= self.IsFillForTableYear(parseInt(self.searchModel.FillInYear));
                self.searchModel.FillInYear = self.searchModel.FillInYear;
            } else {
                 self.isFull= self.IsFillForTableYear(self.CurrentYear);   
                self.searchModel.FillInYear = self.CurrentYear + '年';//填报年度-----数据字典值
            }
            this.searchModel.AreaCode = user.AreaCode;
            self.$http.post('Report/PostPageList', this.searchModel).then(function (res) {
                if (res.data.status === 1) {
                    self.datas = res.data;
                } 
                else {
                    self.$Modal.error({
                        title: '提示信息',
                        content: res.data.message
                    });
                }
            });
        },
        //编辑获取对象传入id
        Edit: function (id, reportCode,status) {
            var self = this;
            self.ReportStatus=status;
            self.ReportId=id;
            this.$http.get("Report", {
                params: {
                    id: id,
                    reportCode: reportCode
                }
            }).then( //获取数据编辑项的值
                function (res) {
                    switch (res.data.list.status) {
                        case 1:
                            self.ItemList=res.data.list.model;
                            self.modalShow();
                            break;
                        case 0:
                            self.$Modal.error({
                                title: "提示信息",
                                content: "编辑数据加载失败!!!"
                            });
                            break;
                        case -1:
                            self.$Modal.error({
                                title: "提示信息",
                                content: "编辑数据加载失败!!!"
                            });
                            break;
                    }
                }
                );
        },
        //删除对象
        Delete(id) {
            var self = this;
            self.$Modal.confirm({
                title: '提示信息',
                content: '<p>数据删除后不可恢复，确定要删除？</p>',
                onOk: () => {
                    this.$http.delete("GenerateLog", {
                        params: {
                            id: id
                        }
                    }).then(
                        function (res) {
                            if (res.data.status == 1) {
                                self.$Notice.success({
                                    title: '删除成功！',
                                    desc: false
                                });
                                self.getPageData();
                            } else {
                                self.$Modal.error({
                                    title: "提示信息",
                                    content: "数据删除失败!!!"
                                });
                            }
                        }
                        );
                }
            });
        },
        //保存方法
        save() {
            var self = this;
            this.$http.put('VegProSurvey', self.ItemList).then(
                function (res) {
                    if (res.data.status == 1) {
                        self.getPageData(); //读取分页数据
                        self.$Notice.success({
                            title: '保存成功!',
                            desc: false
                        });
                        self.showType=false;
                        self.getPageData(); //读取分页数据
                    } else {
                        self.$Modal.warning({
                            title: "提示信息",
                            content: "更新失败,请与管理员联系!"
                        });
                    }
                });
        },
        //数据上报
        DataUp: function (Status, Msg) {
            var self = this;
            self.searchModel.Id = self.ReportId;
            self.searchModel.Status = Status;
            self.searchModel.Opinion = Msg;
            self.$Modal.confirm({
                title: '提示信息',
                content: '<p>数据上报后，不能再更改，是否继续上报？</p>',
                onOk: () => {
                    self.$http.post('Report/PostUpStatus', self.searchModel).then(function (res) {
                        if (res.data.status === 1) {
                            self.$Notice.success({
                                title: '数据上报成功',
                                desc: false
                            });
                            self.searchModel.Status = '';
                            self.showType=false;
                            self.getPageData(); //读取分页数据
                        } else {
                            self.$Notice.success({
                                title: '数据上报失败',
                                desc: res.data.messages
                            });
                        }
                    });
                },
                onCancel: () => { }
            });
        },
        //编辑框打开
        modalShow() {
            this.showType = true;
        },
        //编辑框关闭
        modalHide() {
            this.showType = false;
        },
        //取消方法
        cancel() {
            this.showType = false; //关闭modal
            this.TabTitleList = [];
        },
        //重置model
        restModel(modelname) {
            this.$refs[modelname].resetFields(); //重置model
        },
        //全选方法
        selectAll(selection) {
            this.dataIds = selection;
        },
        //checkbox选中方法
        selectSingel(selection, row) {
            this.dataIds = selection;
        },
        //checkbox取消选中方法
        selecChange(selection) {
            this.dataIds = selection;
        },
        TmpDown: function () {//模板下载
            window.open(this.$http.defaults.baseURL + "Report/GetTemplateData?ReportCode=VegProSurveyYear");
        },
        //导出
        ExcelDown: function (ReportId) {
            var self = this;
            window.open(this.$http.defaults.baseURL + "VegProSurvey/GetExcelDataYear?ReportId=" + ReportId + "&&FillInYear=" + this.CurrentYear);
        },
        //导入
        GetPostUrl(ReportId) {
            var url = this.$http.defaults.baseURL + "Report/PostImportDataTwoYear?ReportId=" + ReportId;
            return url;
        },
        handleSuccess() {
            this.getPageData();
            this.$Notice.success({
                title: '数据导入成功！',
                desc: false
            });
        },
        
    },
    //创建Vue页面方法
    created: function () {
        //创业Vue前调用获取this.datas: {},//table数据对象
        this.getPageData();
    },
    watch: {
        //需要监听的在此处新增监听对象
    }
}
</script>
<style scoped src="../../../styles/stats.css"></style>